Test for bad path overrides with summaries
authorAlex Crichton <alex@alexcrichton.com>
Mon, 28 Nov 2016 16:51:36 +0000 (08:51 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 28 Nov 2016 17:09:45 +0000 (09:09 -0800)
commit772e1a17b4e528c602d48002593726ebf6d126cf
tree390aafc5083f4198db622006ffb9d4a7b5a64d7b
parent3568be94c0ca73488954ad209c07e7998786b3d9
Test for bad path overrides with summaries

Bad path overrides are currently detected to issue warnings in cases where path
overrides are not suitable and have exhibited buggy behavior in the past.
Unfortunately though it looks like some false positives are being issued,
causing unnecessary confusion about `paths` overrides.

This commit fixes the detection of these "bad path overrides" by comparing
`Summary` dependencies (what's written down in `Cargo.toml`) rather than
comparing the `Cargo.toml` of the override with `Cargo.lock`. We're guaranteed
that the package we're overridding has already been resolved into `Cargo.lock`,
so we know that if the two `Cargo.toml` files are equivalent we'll continue
with the same crate graph.

I'm not actually entirely sure why I originally thought it'd be better to go
through the `Cargo.lock` comparison route. Unfortunately that doesn't take into
account optional deps which aren't in `Cargo.lock` but are in `Cargo.toml` of
the override, causing the false positive. This method, however, simply ensures
that the two dependency lists are the same.

Closes #3313
src/cargo/core/dependency.rs
src/cargo/core/registry.rs
tests/overrides.rs